/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Projects
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _INTEGER_ENTRY_HPP_
#define _INTEGER_ENTRY_HPP_

#include <gtkmm.h>
///@class IntegerEntry
///@brief A GUI entry zone for integer values
class IntegerEntry: public Gtk::Entry
{
	public:
		//Default constructor
		IntegerEntry();
		//Destructor
		virtual ~IntegerEntry();
		//Set the value
		void SetValue(int);
		//Get the value
		int GetValue();
        ///@brief Set the entry to display the value if it is equal to zero
        void DisplayIfZero();
        ///@brief Set the entry to not display the value if it is equal to zero
        void NotDisplayIfZero();
         
	protected:
		//Update the value When the content of the entry is changed
		virtual void on_changed();	
	private:
        ///@brief the value in edition
		int value;
        ///@brief flags indicating if something should be displayed if the value is zero
        bool displayIfZero;

};

#endif // _INTEGER_ENTRY_HPP_
